package week10;

import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Main11 {

	public static void main(String[] args) {
		ExecutorService exec = Executors.newCachedThreadPool();
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();// num of tasks
		List<CalculateTask> taskList = new ArrayList<CalculateTask>();
		List<Future<Integer>> results = new ArrayList<Future<Integer>>();
		int sum = 0, k =0;
		for(int i = 0 ; i < n ; i ++ ){
			taskList.add(new CalculateTask(i));
		}
		for (CalculateTask task : taskList) {
			results.add(exec.submit(task));
		}
		try{for (Future<Integer> future : results) {
			sum = future.get() + sum;
			}}catch(Exception e){
			}
		System.out.println("sum="+sum);
		exec.shutdown();
	}
}

class CalculateTask implements Callable{

	
	private int n;
	public CalculateTask(int n){
		this.n = n;
	}
	@Override
	public Integer call() throws Exception {
		// TODO Auto-generated method stub
		int a=1, b=1 ,sum=0;
		if( n == 0)
			return 1;
		if( n == 1)
			return 1;
		for(int i = 1 ; i < n ; i++){
			sum = a+b;
			a = b;
			b = sum;
		}
		return sum;
	}
	
}
/* 你的答案： */